<template>
  <div class="child">
    <h3>子组件</h3>
    <h3>儿子玩具：{{ toy }}</h3>
    <button @click="emitAA('send-toy', toy)">发送给父</button>
  </div>
</template>

<script setup lang="ts" name="Child">
import { ref } from "vue";
let toy = ref("奥特曼");
//声明事件用emit发送数据
const emitAA = defineEmits(["send-toy"]);
console.log("emitAA", emitAA);
</script>

<style scoped>
.child {
  background-color: skyblue;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 0 10px black;
}
</style>
